home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The 640 MEG Shareware Studio 2
/
The 640 Meg Shareware Studio CD-ROM Volume II (Data Express)(1993).ISO
/
clang
/
tcplusx.zip
/
MOUSE.H
< prev
next >
Wrap
C/C++ Source or Header
|
1991-02-28
|
4KB
|
149 lines
#ifndef _MOUSE_H
#define _MOUSE_H
//
// mouse.h - header file for class Mouse
// Author - Robin W. McKean
// Last Update - February 23,1991
// Copyright (C) 1991 All rights reserved
//
// This file remains the property of the author, Robin W. McKean. You are
// free to use and change it as you see fit. This module, nor its object
// code, may not however be included in any packaged software without the
// written consent of the author.
//
// Contents ----------------------------------------------------------------
//
// Mouse
//
// Description
//
// Defines the class Mouse. The purpose of this class is to serve
// as input device for mouse actions. This provides an integrated
// method of recieving and translating mouse and keyboard actions into
// events in a manner that is transparent to the user.
//
// End ---------------------------------------------------------------------
// Interface Dependencies ---------------------------------------------------
#ifndef _IOSTREAM_H
#include <iostream.h>
#define _IOSTREAM_H
#endif
#ifndef _GEN_H
#include <gen.h>
#endif
#ifndef _USETYPES_H
#include <usetypes.h>
#endif
#ifndef _OBJECT_H
#include <object.h>
#endif
#ifndef _EVENT_H
#include <event.h>
#endif
#ifndef _DEVICE_H
#include <device.h>
#endif
// End Interface Dependencies ------------------------------------------------
// Class //
class Mouse : public Device
{
public:
Mouse( int initStatus = D_ON );
Mouse( Device& );
~Mouse( void );
classType isA( ) const;
char *nameOf( ) const;
int processA( Event& );
void pollDevice( );
void setLines( unsigned char a_lines )
{ lines = a_lines; }
void setColumns( unsigned char a_col )
{ columns = a_col; }
void setCellHeight( unsigned char cellH )
{ cellHeight = cellH; }
void setCellWidth( unsigned char cellW )
{ cellWidth = cellW; }
private:
unsigned int mouseButtonPressed;
unsigned char cellWidth, cellHeight;
unsigned char lines, columns;
};
// Description --------------------------------------------------------------
//
// The mouse class does processes events from, what else, a mouse.
// It reads a two or three button mouse and translates the events it
// recieves into button presses, releases or continue selects. See
// gen.h for a complete list of possible event types.
//
// Constructor
//
// Mouse( int initStatus = D_ON )
//
// Initializes the device, and determines if a mouse is present on
// the computer.
//
// Mouse( Mouse& )
//
// Copy constructor, copies one device into another.
//
// Destructor
//
// ~Mouse()
//
// Turns the mouse off
//
// Member Functions
//
// isA( )
//
// Returns character class type mouseClass
//
// nameOf( )
//
// Returns a character representation of class, "Mouse"
//
// printOn( ostream& )
//
// Prints the contents of the class in a logical fashion
//
// processA( Event& )
//
// Responsible for taking an event, and processing the contents if
// applicable to this device
//
// pollDevice( )
//
// Requests information from a device, and translated into an event
// which is fed directly into the event manager's queue.
//
// Inherited Members
//
// isSortable( ) inherited from Object
// isAssociation( ) inherited from Object
// operator new inherited from Object
// firstThat( ) inherited from Object
// lastThat( ) inherited from Object
// hashValue( ) inherited from Device
// isEqual( ) inherited from Device
//
// End Description ----------------------------------------------------------
#endif // _MOUSE_H //